<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<title>Inventory</title>
</h:head>

<h:body>

	<ui:composition template="/WEB-INF/templates/1000_layout.xhtml">
		<ui:param name="menuInventoryClass" value="selected" />

		<ui:define name="content">
			<p:tabView id="tabView">
				<p:tab title="Inventory">
					<h:form id="formInventoryTable">
						<ui:include src="/WEB-INF/templates/entity/inventory.table.xhtml">
							<ui:param name="ajaxRowSelectUpdate"
								value=":tabView:formInventoryDialog:itemDetail" />
						</ui:include>
					</h:form>
					<h:form id="formInventoryDialog">
						<ui:include
							src="/WEB-INF/templates/entity/inventory.table.dialog.xhtml" />
					</h:form>
				</p:tab>
				
				<p:tab title="Warehouse">
					<ui:include src="/WEB-INF/templates/entity/warehouse.table.xhtml" />
				</p:tab>
				<p:tab title="Returns">
					<h:form id="formBalanceTable">
						<ui:include
							src="/WEB-INF/templates/entity/returnsBalance.table.xhtml" />
					</h:form>
					<br />
					<p:fieldset legend="Add Returns" toggleable="true"
						toggleSpeed="500" collapsed="true">
						<h:form>
							<ui:include src="/WEB-INF/templates/entity/partUnit.table.xhtml">
								<ui:param name="ajaxRowSelectUpdate"
									value=":tabView:partUnitForm:returnsDetail" />
								<ui:param name="ajaxRowSelectOnComplete"
									value="PF('returnsDialog').show()" />
							</ui:include>
						</h:form>
						<h:form id="partUnitForm">
							<ui:include
								src="/WEB-INF/templates/entity/returnsBalance.table.dialog.xhtml" />
						</h:form>
					</p:fieldset>
				</p:tab>
				<p:tab title="Audit">
					<ui:include
						src="/WEB-INF/templates/entity/inventoryAudit.table.xhtml" />
				</p:tab>
				<p:tab title="Admin">
					<h:form>
						<p:commandButton value="Initialize" id="nonAjax"
							action="#{dtInventoryLazyView.initData}" ajax="false" />
					</h:form>
				</p:tab>
			</p:tabView>

		</ui:define>

	</ui:composition>
</h:body>
</html>